<?php
require_once 'smarty_lib/Smarty.class.php';
require_once 'lib/DBClass.php';
require_once 'lib/Account.php';
require_once 'lib/Reg.php';

$smarty = new Smarty();
$acc = new Account();
$reg = new Reg();

$smarty->template_dir = 'template/';
$smarty->compile_dir = 'template_c/';

if(!$acc->validate_cookie()){
	$smarty->assign('error','Anda tidak mepunyai akses untuk membuka halaman ini');
	$smarty->display('login.html');
}else{	

	$smarty->assign('cookie', $acc->get_cookie());
	$smarty->assign('page','personal.html');
	$smarty->assign('title','Index');

	$smarty->display('headkun.html');
}
if (isset($_POST['submit'])) {
	$data = $reg->edit_member();
	$smarty->assign('reg', $data);
}
?>
